This disclosure relates generally to the field of image processing and, more particularly, to various techniques for generating refined, high fidelity normal maps to allow 2D and 3D graphics rendering and animation infrastructures to be able to render three-dimensional lighting effects on two-dimensional texture maps—without the need for the corresponding normal maps to be created and/or supplied to the rendering and animation infrastructure by the designer or programmer.
Graphics rendering and animation infrastructures are commonly used by programmers today and provide a convenient means for rapid application development, such as for the development of gaming applications on mobile devices. Because graphics rendering and animation infrastructures may utilize the graphics hardware available on the hosting device to composite 2D and 3D scenes at high frame rates, programmers can create and use complex special effects and texture atlases in games and other application with limited programming overhead.
For example, Sprite Kit developed by APPLE INC., provides a graphics rendering and animation infrastructure that programmers may use to animate arbitrary textured images, or “sprites.” Sprite Kit uses a traditional rendering loop, whereby the contents of each frame are processed before the frame is rendered. Each individual game determines the contents of the scene and how those contents change in each frame. Sprite Kit then does the work to render the frames of animation efficiently using the graphics hardware on the hosting device. Sprite Kit is optimized so that the positions of sprites may be changed arbitrarily in each frame of animation.
Sprite Kit supports many different kinds of content, including: untextured or textured rectangles (i.e., sprites); text; arbitrary CGPath-based shapes; and video. Sprite Kit also provides support for cropping and other special effects. Because Sprite Kit supports a rich rendering infrastructure and handles all of the low-level work to submit drawing commands to OpenGL, the programmer may focus his or her efforts on solving higher-level design problems and creating great gameplay. The “Sprite Kit Programming Guide” (last updated Feb. 11, 2014) is hereby incorporated by reference in its entirety.
The inventors have realized new and non-obvious ways to render refined, high fidelity three-dimensional lighting effects on two-dimensional texture maps—without the need for the programmer to undertake the sometimes complicated and time-consuming process of providing a corresponding normal map for each texture that is to be used in his or her application. Using the techniques disclosed herein, the graphics rendering and animation infrastructure may provide the same or similar lighting effects on the texture in “real-time” as would be provided on a texture that was explicitly supplied with normal map by the programmer.